#!/bin/bash
echo "🚀 开始部署: $(date)" >> logs/deploy.log

cd /project/svelte || exit

git fetch origin master >> logs/deploy.log 2>&1

git reset --hard origin/master >> logs/deploy.log 2>&1

pnpm install >> logs/deploy.log 2>&1

pnpm build >> logs/deploy.log 2>&1

pm2 restart svelte >> logs/deploy.log 2>&1

echo "✅ 部署完成: $(date)" >> logs/deploy.log

exit 0